<div id="content">

    <div id="content-header">

        <div id="breadcrumb"><a href="<?php echo site_url('Login/login') ?>" title="Go to Home" class="tip-bottom"><i
                class="icon-home"></i> 主页</a> <a href="#" class="current">订单管理</a></div>

        <h1>订单列表页面</h1>

    </div>

    <div class="container-fluid">

        <hr>

        <div class="row-fluid">

            <div class="span12">
                <div class="widget-box">
                    <div class="widget-title"><span class="icon"><i class="icon-th"></i></span>
                        <h5>Data table</h5>
                        <?php  $url=site_url('order/orderListDownload')?>
                        <span style="position:absolute;right:0;">
                            <button class="btn btn-success btn-mini" onClick="window.open('<?php echo $url?>','_self')">导出列表</button>
			</span>
                    </div>

                    <div class="widget-content nopadding">

                        <table class="table table-bordered data-table">

                            <thead>

                            <tr>
                                <th>订单号</th>
                                <th>创建时间</th>
                                <th>ID</th>
                                <th>上级代理</th>
                                <th>标题</th>
                                <th>金额</th>
                                <th>支付方式</th>
                                <th>支付时间</th>
                                <th>支付状态</th>
                                <th>类型</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php
                            $rows=$data[0];
                            foreach($rows as $value):
                            ?>
                            <tr class="gradeX">
                                <td><?php  echo $value['order_id']?></td>
                                <td><?php  echo date('Y-m-d H:i:s',$value['create_time'])?></td>
                                <td><?php  echo $value['agent_id']?></td>
                                <td><?php  echo $value['father_id']?></td>
                                <td><?php  echo $value['title']?></td>
                                <td><?php  echo $value['total_fee']?></td>
                                <td><?php  echo $value['pay_way']?></td>
                                <td><?php  echo date('Y-m-d H:i:s',$value['pay_time'])?></td>
                                <td class="center"><?php
                                $state=$value['state'];
                                if($state==0){
                                echo "待支付";
                                }else if($state==1){
                                echo "支付中";
                                }else{
                                echo "支付成功";
                                }
                                ?></td>
                                <td><?php
                                $state=$value['type'];
                                if($state==0){
                                echo "代理";
                                }else if($state==1){
                                echo "安卓";
                                }else{
                                echo "IOS";
                                } ?></td>
                                <td>
				  <span>

                      <?php
                       $id=intval($value['id']);
                       $url=site_url("order/closeOrder/$id");
?>
                      <button class="btn btn-warning btn-mini"
                              onClick="window.open('<?php echo $url ?>','_self')">关闭订单
                    </button>

				  </span>
                                </td>

                            </tr>
                            <?php    endforeach; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

        </div>

    </div>

</div>